<?php

class Faculty{
  var  $facultyId; 
  var $facultyName;
   
  var $department;
  var $facultyManagingBoard;
   
 function __construct() {}
 function getFID(){
    return $this->facultyId;
 }
 function getFName(){
    return $this->facultyName;
    
 }
 function getDepartment(){
    return $this->department;
 }
 function getFmnB(){
    return $this->facultyManagingBoard;
 }
 function setFID($newFID){
    $this->facultyId = $newFID;
    
 }
 function setFName($newFName){
    $this->facultyName = $newFName;
    
 }
 function setDepartment($newDepartment){
    $this->department = $newDepartment;
 }
 function setFMnB($newFmnB){
    $this->FacultyManagingBoard = $newFmnB;
 }
 
   function checkLogin($facultyName,$facultyPass){
        $sql = "select * from faculty where FACULTY_ID like '".$facultyName."' and FACULTY_PASS like '".$facultyPass."'";
        $query=mysql_query($sql);  
        $check = false;
        while($row=mysql_fetch_array($query))
            {   $check = true; }

        return $check;
    }
    function approCourse($regid){
        $sql = "Update CourseRegistration set approved='approved' where registrtion_ID='".$regid."'";
        mysql_query($sql);
    }
    function approCourseStudent($studentid){
        $sql = "update courseregistration SET approved = 'approved' where student_id ='".$studentid."'";
        mysql_query($sql);
    }
    function addGrade($studentid,$courseid,$finalgrade,$semester){
        $sql = "insert into courseattendence (STUDENT_ID,COURSE_ID,FINAL_GRADE,ATTENDANCE_SEMESTER) values ('".$studentid."','".$courseid."',".$finalgrade.",".$semester.")";
        mysql_query($sql);
    }
    function editGrade($gradeid,$finalgrade,$semester){
        $sql = "update courseattendence set FINAL_GRADE='".$finalgrade."',ATTENDANCE_SEMESTER='".$semester."' where ATTENDANCE_ID=".$gradeid;
        mysql_query($sql);
    }
     function deleteGrade($gradeid){
        $sql = "delete from courseattendence where ATTENDANCE_ID = ".$gradeid;
        mysql_query($sql);
    }
}



?>